package com.imooc.coupon.gateway.filter;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * 记录用户请求开始时间
 * Created By TINY
 * Create Time 2020/2/9 - 11:56
 **/
@Slf4j
@Component
public class PreRequestFilter extends AbstractPreZuulFilter {
    @Override
    protected Object cRun() {
        context.set("startTime", System.currentTimeMillis());

        return success();
    }

    @Override
    public int filterOrder() { return 0; }
}
